﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using VideoMeetting.Base;
using VideoMeetting.Base.DomainModel;

namespace VideoMeettingServer
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的类名“DataService”。
    public class DataService : IDataService
    {
        public Task<ResponseInfo<List<MeettingRoom>>> GetMeettingRooms()
        {
            return Task.FromResult(new ResponseInfo<List<MeettingRoom>>() { Data = RoomManager.Rooms });
        }

        public Task<ResponseInfo> CreateRoom()
        {
            var room = RoomManager.AddRoom();

            if (room == null) return Task.FromResult(new ResponseInfo(false, "创建失败"));

            return Task.FromResult(new ResponseInfo());
        }
    }
}
